<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>问答详情</title>
    <link rel="stylesheet" type="text/css" href="../style/api.css" />
    <link rel="stylesheet" type="text/css" href="../style/head.css" />
    <style>
        #closeIt {
            position: absolute;
            top: 35px;
            left: 1rem;
            width: 2rem;
            height: 2rem;
        }

        main {
            padding-top: 75px;
            border-top: 1px solid #ccc;
        }

        .answer {
            background-color: #fff;
            display: flex;
            align-items: center;
            padding: 1rem;
            border-bottom: 1px dashed #ccc;
        }

        .answer span:nth-child(1) {
            font-weight: bold;
            color: #3949AB;
        }
        .question {
            padding: 1rem;
            background-color: #fff;
        }
        .question h4 {
            color: #3949AB;
            margin-bottom: 0.5rem;
        }
        .question p {
            line-height: 1.5;
        }
    </style>
</head>

<body>
    <header>
        问题详情
        <img src="../img/icons/back.png" alt="" onclick="api.closeWin()" id="closeIt">
    </header>
    <main>

    </main>
</body>
<script type="text/template" id="detail">
  {{~it.items:value:index}}
  <div class="answer">
      <span>【问】：</span>
      <span>{{=value.question_title}}</span>
  </div>
  <div class="question">
      <h4>【答】：</h4>
      {{=value.question_answer}}
  </div>
  {{~}}
</script>
<script type="text/javascript" src="../js/api.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/doT.min.js"></script>
<script type="text/javascript" src="../js/rend.js"></script>
<script type="text/javascript">
    apiready = function() {
        getDetail();
    };

    function getDetail() {
        api.ajax({
            url: 'http://114.116.243.15/newbtb/appinfo/qaDetail.lecture',
            method: 'post',
            data: {
                body: {
                    'tbname': 'lecture_question',
                    'id': api.pageParam.id,
                }
            }
        },function(ret, err){
            if (ret) {
                if(ret.status == 1) {
                    $('main').html(btbRender('detail',[ret.data]));
                }
            }
        });
    }
</script>

</html>
